package cn.lwj.webService.init;

import cn.lwj.webService.webService.impl.DemoWebServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.xml.ws.Endpoint;

/**
 * 用于发布WebService的Servlet
 * 使用Servlet3.0提供的@WebServlet注解将继承HttpServlet类的普通Java类标注为一个Servlet
 * 将value属性设置为空字符串，这样WebServicePublishServlet就不提供对外访问的路径
 * loadOnStartup属性设置WebServicePublishServlet的初始化时机
 */
//@WebServlet(value = "", loadOnStartup = 0)//暂时注释掉,测试别的方式
public class WebServicePublishServlet extends HttpServlet {
    public void init() throws ServletException {
        //成功
        System.out.println("初始化进入WebServicePublishServlet了!!!!!!!!!");
        //通过监听类发布webservice
        //定义webService的发布地址
        //String address = "http://149.0.40.31:8086/demoWebService/";
        //Endpoint.publish(address, new DemoWebServiceImpl());
        //System.out.println("webService发布成功!");
    }
}
